package com.liao.badminton.code;

public enum RespCodeMessage {
    /**
     * 成功
     */
    SYSTEM_SUCCESS(10200, "ok"),
    /**
     * 1开头是系统异常
     */
    SYSTEM_ERROR(11500, "系统异常"),
    //redis
    REDIS_CONNECT_ERROR(11600, "redis 连接异常"),
    REDIS_SAVE_ERROR(11601, "redis保存数据异常：{}"),
    //security
    SECURITY_LOGIN_ERROR(11700, "登录失败：{}"),
    SECURITY_SESSION_IVN(11701, "登录失效：{}"),
    SECURITY_ACCOUNT_LOCK(11702, "账户被锁定：{}"),
    SECURITY_CREDENTIAL_EXPIRE(11703, "证书过期：{}"),
    SECURITY_ACCOUNT_EXPIRE(11704, "账户过期：{}"),
    SECURITY_ACCOUNT_FORBIDDEN(11705, "账户被禁用：{}"),
    SECURITY_ACCOUNT_UN_LOGIN(11706, "用户未登录：{}"),
    SECURITY_ACCOUNT_UN_AUTHOR(11707, "用户权限不足：{}"),
    SECURITY_ACCOUNT_LOGOUT_FAIL(11708, "退出失败：{}"),
    SECURITY_TOKEN_FORMAT(11709, "token 格式错误：{}"),
    SECURITY_PASSWORD_ERROR(11710, "账号或密码错误：{}"),

    //    sentinel
    SENTINEL_LIMIT_FLOW(11800, "流量限制：{}"),
    SENTINEL_DEGRADE(11801, "降级：{}"),
    SENTINEL_UN_AUTHOR(11802, "权限不足：{}"),
    SENTINEL_LIMIT_PARAM(11803, "参数限制：{}"),
    // gateway
    GATEWAY_GET_TOKEN_KEY(11901, "获取token公钥异常：{}"),
    GATEWAY_NOT_SERVER(11904, "服务未找到：{}"),
    //mysql
    MYSQL_CONNECT_ERROR(12000, "mysql 连接异常"),
    MYSQL_DATA_ERROR(12001, "mysql数据异常：{}"),
    /**
     * 2开头是业务异常
     */
    //param 214开头是参数异常
    PARAM_LACK(21404, "参数缺失：{}"),
    PARAM_ERROR(21405, "参数错误：{}"),
    PARAM_FILE_UPLOAD(21406, "文件上传有误：{}"),
    PARAM_FORMAT_ERROR(21407, "参数格式错误：{}"),

    PARAM_FILE_UPLOAD_SAVE(21407, "文件保存异常"),
    //process 215开头是数据异常
    DB_DATA_NULL(21500, "数据不存在：{}"),
    DB_DATA_EXIST(21501, "数据已存在：{}"),
    //

    HANDLE_FILE_UPLOAD_ERROR(22001, "文件上传失败：{}"),
    ;
    Integer code;
    String message;

    RespCodeMessage(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
